using System;
using System.Collections.Generic;
using System.Text;

namespace Colman.Rpg
{
    /// <summary>
    /// Represents a magic item.
    /// </summary>
    [Serializable]
    public class MagicItem : Item
    {
        /// <summary>
        /// Creates a new instance of <see cref="MagicItem" />.
        /// </summary>
        /// <param name="defensePoints">The defense points gained by using the item.</param>
        /// <param name="attackPoints">The attack points gained by using the item.</param>
        /// <param name="name">The name of the item.</param>
        /// <param name="amount">The amount of the same item.</param>
        /// <param name="cost">The cost of the item, per unit.</param>
        /// <param name="typeName">The name of the type of this item.</param>
        public MagicItem(int defensePoints, int attackPoints, string name, int cost, int amount, string typeName)
            : base(defensePoints, attackPoints, name, amount, cost)
        {
            this.typeName = typeName;
        }

        #region string TypeName { get; } (typeName)
        private string typeName;

        /// <summary>
        /// Gets the defense points the armor has.
        /// </summary>
        public string TypeName
        {
            [System.Diagnostics.DebuggerStepThrough]
            get
            {
                return this.typeName;
            }
        }
        #endregion

        /// <summary>
        /// Gets the same item as the current object is, only with the <see cref="Item.Amount"/> property set to 1.
        /// </summary>
        /// <returns>The same item as the current object is, only with the <see cref="Item.Amount"/> property set to 1.</returns>
        public override Item GetOne()
        {
            return new MagicItem(this.DefensePoints, this.AttackPoints, this.Name, this.Cost, 1, this.typeName);
        }
    }
}
